<?php
App::uses('AppModel', 'Model');
/**
 * Winningstudentworksleading Model
 *
 * @property Competitionleveltype $Competitionleveltype
 * @property Recstatus $Recstatus
 */
class Winningstudentworksleading extends AppModel {

/**
 * Validation rules
 *
 * @var array
 */
	public $validate = array(
		'competitionleveltype_id' => array(
			'numeric' => array(
				'rule' => array('numeric'),
				'message' => 'Выберите уровеь конкурса',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'competition_name' => array(
			'notEmpty' => array(
				'rule' => array('notEmpty'),
				'message' => 'Введите название конкурса',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'competition_owner' => array(
			'notEmpty' => array(
				'rule' => array('notEmpty'),
				'message' => 'Введите название организатора конкурса',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'studentwork_name' => array(
			'notEmpty' => array(
				'rule' => array('notEmpty'),
				'message' => 'Введите название стденческой работы',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'won_prize' => array(
			'notEmpty' => array(
				'rule' => array('notEmpty'),
				'message' => 'Введите название полученного поощрения',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'begindate' => array(
			'date' => array(
				'rule' => array('date'),
				'message' => 'Введите дату начала конкурса',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'enddate' => array(
			'date' => array(
				'rule' => array('date'),
				'message' => 'Введите дату окончания конкурса',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'recstatus_id' => array(
			'numeric' => array(
				'rule' => array('numeric'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
	);

	//The Associations below have been created with all possible keys, those that are not needed can be removed

/**
 * belongsTo associations
 *
 * @var array
 */
	public $belongsTo = array(
		'Competitionleveltype' => array(
			'className' => 'Competitionleveltype',
			'foreignKey' => 'competitionleveltype_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'Recstatus' => array(
			'className' => 'Recstatus',
			'foreignKey' => 'recstatus_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		)
	);
}
